Portable electronic devices such as mobile phones and tablet computers have become indispensable. Rechargeable batteries such as lithium ion batteries are an essential part of mobile electronic devices. Consequently, technologies for efficient, fast, and safe charging of batteries are of critical importance. A battery in a mobile device may be charged by a dedicated charger connecting the mobile device to an outlet or a battery pack. In some situations, it may be desirable to charge the battery of a first electronic device by a second electronic device. Typically, the second electronic device would convert the output of its battery through its power management module to a fixed voltage and supply the fixed voltage to the first electronic device. The first electronic device would monitor and acquire in real-time a required safe charging voltage according to the charge state of its battery and convert through its power management module the fixed voltage supplied by the second electronic device to the required charging voltage. Thus, there would be two voltage conversions, one by the first electronic device and the other by the second electronic device. Power lost accompanies each of these two voltage conversions.